﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using BlobTowerDefense.Resources;
using System.Globalization;
using System.Windows.Navigation;

namespace BlobTowerDefense.Pages.Controls
{
    public partial class ControlsSettings_Languages : UserControl
    {
        public event TextChangedEventHandler Language_Changed;

        public ControlsSettings_Languages()
        {
            InitializeComponent();
        }

        private void Button_LanguageEN_Click(object sender, RoutedEventArgs e)
        {
            ApplicationResources.UiCulture = new CultureInfo("en-GB");
            Language_Changed.Invoke(sender, null);
        }

        private void Button_LanguageDE_Click(object sender, RoutedEventArgs e)
        {
            ApplicationResources.UiCulture = new CultureInfo("de-DE");
            Language_Changed.Invoke(sender, null);
        }

        private void Button_LanguageSK_Click(object sender, RoutedEventArgs e)
        {
            ApplicationResources.UiCulture = new CultureInfo("sk-SK");
            Language_Changed.Invoke(sender, null);
        }

        private void Button_LanguageCZ_Click(object sender, RoutedEventArgs e)
        {
            ApplicationResources.UiCulture = new CultureInfo("cs-CZ");
            Language_Changed.Invoke(sender, null);
        }

        private void Button_LanguageES_Click(object sender, RoutedEventArgs e)
        {
            ApplicationResources.UiCulture = new CultureInfo("es-ES");
            Language_Changed.Invoke(sender, null);
        }

        private void Button_LanguageIT_Click(object sender, RoutedEventArgs e)
        {
            ApplicationResources.UiCulture = new CultureInfo("it-IT");
            Language_Changed.Invoke(sender, null);
        }

        private void Button_LanguageNL_Click(object sender, RoutedEventArgs e)
        {
            ApplicationResources.UiCulture = new CultureInfo("nl-NL");
            Language_Changed.Invoke(sender, null);
        }

        private void Button_LanguageFR_Click(object sender, RoutedEventArgs e)
        {
            ApplicationResources.UiCulture = new CultureInfo("fr-FR");
            Language_Changed.Invoke(sender, null);
        }
    }
}
